#ifndef _NETWORK_INFO_H_
#define _NETWORK_INFO_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>
#include <sys/select.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "network_common.h"
#include "serial_uart.h"
#include "dictionary.h"
#include "iniparser.h"

#ifdef __cplusplus
extern "C" {
#endif
#define STR_MAX_SZIE 128
#define CONFIG_DIR_NAME "/etc/conf/"
#define CONFIG_INI_NAME "/etc/conf/config.ini"
typedef enum FILE_TYPE_E
{
    TYPE_DIR,
    TYPE_FILE
}FILE_TYPE_E;

typedef struct Str_S{
    char str[STR_MAX_SZIE];
} Str_S;

void *tcp_listener_thread(void *arg);
int create_empty_ini_file();
int write_netinfo_to_ini(void *st, char *filename);
int write_chipctrl_to_ini(void *st, char *filename);
int write_rtspurl_to_ini(void *st, char *filename);

int get_netinfo_from_ini(NetInfo *net_info, char *filename);
int get_chipctrl_from_ini(ChipCtrl *chip_ctrl, char *filename);
int get_rtspurl_from_ini(void *url, char *filename);
#ifdef __cplusplus
}
#endif

#endif